import {

  realTimeBasicApi,
  realTimeRechargeApi,
  realTimeRechargeUserApi,
  realTimeWithdrawApi,
  realTimeWithdrawUserApi,
  realTimeOnUserApi,
  realTimeNewUserApi,
  realTimeOnPointsApi,
  realTimeActiveUserApi,
  realTimeBettingAmountApi,
  realTimeBettingWinApi,
  realTimeBettingEffectAmountApi,
  realTimeBettingUserApi,
  realTimeFirstRechargeUserApi,
  realTimeFirstRechargeApi,
  // realTimeTotalFirstRechargeApi,
  // realTimeTotalFirstRechargeUserApi,
  realTimePromoUserApi,
  realTimePromoAmountApi,
  realTimePromoInfoApi,
  realTimeOnlineApi,//暂时不确定接口对应功能
  realTimeGameProfitBasicApi,
  realTimeGameProfitApi,
} from '@/services/api/operationalRealTime';
// import {
//   realTimePromoInfoApi,
//   trendPromoInfoApi,
//   promoInfoListApi,
//   promoInfoDetailListApi
// } from '@/services/api/operationalRealTime'
const report = {
  state: {
    basic: undefined,//基础信息
    recharge: undefined,//实时统计
    rechargeUser: undefined,
    withdraw: undefined,
    withdrawUser: undefined,
    upAmountUnique: undefined,
    onPoints: undefined,
    newUser: undefined,
    activeUser: undefined,
    bettingAmount: undefined,
    bettingWin: undefined,
    bettingEffect: undefined,
    bettingUser: undefined,
    promoUser: undefined,
    promoAmount: undefined,
    online: undefined,
    gameProfitBasic: undefined,
    gameProfit: undefined,
    firstSaveUser: undefined,
    rechargeMoney: undefined,
    // totalFirstSaveUser: undefined,
    // totalRechargeMoney:undefined
  },

  mutations: {
    [types.SET_REAL_TIME_BASIC]: (state, data) => {
      state.basic = data
    },
    [types.SET_REAL_TIME_RECHARGE]: (state, data) => {
      state.recharge = data
    },
    [types.SET_REAL_TIME_RECHARGE_USER]: (state, data) => {
      state.rechargeUser = data
    },
    [types.SET_REAL_TIME_WITHDRAW]: (state, data) => {
      state.withdraw = data
    },
    [types.SET_REAL_TIME_WITHDRAW_USER]: (state, data) => {
      state.withdrawUser = data
    },
    [types.SET_REAL_TIME_UNIQUE]: (state, data) => {
      state.upAmountUnique = data
    },
    [types.SET_REAL_TIME_UP_AMOUNT]: (state, data) => {
      state.onPoints = data
    },
    [types.SET_REAL_TIME_NEW_USER]: (state, data) => {
      state.newUser = data
    },
    [types.SET_REAL_TIME_ACTIVE_USER]: (state, data) => {
      state.activeUser = data
    },
    [types.SET_REAL_TIME_BETTING_AMOUNT]: (state, data) => {
      state.bettingAmount = data
    },
    [types.SET_REAL_TIME_BETTING_WIN]: (state, data) => {
      state.bettingWin = data
    },
    [types.SET_REAL_TIME_BETTING_EFFECT_AMOUNT]: (state, data) => {
      state.bettingEffect = data
    },
    [types.SET_REAL_TIME_BETTING_USER]: (state, data) => {
      state.bettingUser = data
    },
    [types.SET_REAL_TIME_PROMO_USER]: (state, data) => {
      state.promoUser = data
    },
    [types.SET_REAL_TIME_PROMO_AMOUNT]: (state, data) => {
      state.promoAmount = data
    },
    [types.SET_REAL_TIME_ONLINE]: (state, data) => {
      state.online = data
    },
    [types.SET_REAL_TIME_GAME_PROFIT_BASIC]: (state, data) => {
      state.gameProfitBasic = data
    },
    [types.SET_REAL_TIME_GAME_PROFIT]: (state, data) => {
      state.gameProfit = data
    },
    [types.SET_REAL_TIME_RIRSTRECHARGE_USER]: (state, data) => {
      state.firstSaveUser = data
    },
    [types.SET_REAL_TIME_FIRSTRECHARGE_MONEY]: (state, data) => {
      state.rechargeMoney = data
    },
    // [types.SET_TOTALREAL_TIME_RIRSTRECHARGE_USER]: (state, data) => {
    //   state.totalFirstSaveUser = data
    // },
    // [types.SET_TOTALREAL_TIME_FIRSTRECHARGE_MONEY]: (state, data) => {
    //   state.totalRechargeMoney = data
    // },
  },

  actions: {
    async [types.GET_REAL_TIME_BASIC]({commit},params) {
      const [result, data] = await realTimeBasicApi(params);
      if (result) {
        commit(types.SET_REAL_TIME_BASIC, data)
      }
      return {result, data}
    },
    async [types.GET_REAL_TIME_RECHARGE]({commit},params) {
      const [result, data] = await realTimeRechargeApi(params);
      if (result) {
        commit(types.SET_REAL_TIME_RECHARGE, data)
      }
      return {result, data}
    },
    async [types.GET_REAL_TIME_RECHARGE_USER]({commit},params) {
      const [result, data] = await realTimeRechargeUserApi(params);
      if (result) {
        commit(types.SET_REAL_TIME_RECHARGE_USER, data)
      }
      return {result, data}
    },
    async [types.GET_REAL_TIME_WITHDRAW]({commit},params) {
      const [result, data] = await realTimeWithdrawApi(params);
      if (result) {
        commit(types.SET_REAL_TIME_WITHDRAW, data)
      }
      return {result, data}
    },
    async [types.GET_REAL_TIME_WITHDRAW_USER]({commit},params) {
      const [result, data] = await realTimeWithdrawUserApi(params);
      if (result) {
        commit(types.SET_REAL_TIME_WITHDRAW_USER, data)
      }
      return {result, data}
    },
    async [types.GET_REAL_TIME_NEW_USER]({commit},params) {
      const [result, data] = await realTimeNewUserApi(params);
      if (result) {
        commit(types.SET_REAL_TIME_NEW_USER, data)
      }
      return {result, data}
    },
    async [types.GET_REAL_TIME_UNIQUE]({commit},params) {
      const [result, data] = await realTimeOnUserApi(params);
      if (result) {
        commit(types.SET_REAL_TIME_UNIQUE, data)
      }
      return {result, data}
    },
    async [types.GET_REAL_TIME_UP_AMOUNT]({commit},params) {
      const [result, data] = await realTimeOnPointsApi(params);
      if (result) {
        commit(types.SET_REAL_TIME_UP_AMOUNT, data)
      }
      return {result, data}
    },
    async [types.GET_REAL_TIME_ACTIVE_USER]({commit},params) {
      const [result, data] = await realTimeActiveUserApi(params);
      if (result) {
        commit(types.SET_REAL_TIME_ACTIVE_USER, data)
      }
      return {result, data}
    },
    async [types.GET_REAL_TIME_BETTING_AMOUNT]({commit},params) {
      const [result, data] = await realTimeBettingAmountApi(params);
      if (result) {
        commit(types.SET_REAL_TIME_BETTING_AMOUNT, data)
      }
      return {result, data}
    },
    async [types.GET_REAL_TIME_BETTING_WIN]({commit},params) {
      const [result, data] = await realTimeBettingWinApi(params);
      if (result) {
        commit(types.SET_REAL_TIME_BETTING_WIN, data)
      }
      return {result, data}
    },
    async [types.GET_REAL_TIME_BETTING_EFFECT_AMOUNT]({commit},params) {
      const [result, data] = await realTimeBettingEffectAmountApi(params);
      if (result) {
        commit(types.SET_REAL_TIME_BETTING_EFFECT_AMOUNT, data)
      }
      return {result, data}
    },
    async [types.GET_REAL_TIME_BETTING_USER]({commit},params) {
      const [result, data] = await realTimeBettingUserApi(params);
      if (result) {
        commit(types.SET_REAL_TIME_BETTING_USER, data)
      }
      return {result, data}
    },
    async [types.GET_REAL_TIME_RIRSTRECHARGE_USER]({commit},params) {
      const [result, data] = await realTimeFirstRechargeUserApi(params);
      if (result) {
        commit(types.SET_REAL_TIME_RIRSTRECHARGE_USER, data)
      }
      return {result, data}
    },
    async [types.GET_REAL_TIME_FIRSTRECHARGE_MONEY]({commit},params) {
      const [result, data] = await realTimeFirstRechargeApi(params);
      if (result) {
        commit(types.SET_REAL_TIME_FIRSTRECHARGE_MONEY, data)
      }
      return {result, data}
    },
    // async [types.GET_TOTALREAL_TIME_FIRSTRECHARGE_MONEY]({commit}) {
    //   const [result, data] = await realTimeTotalFirstRechargeApi(params);
    //   if (result) {
    //     commit(types.SET_TOTALREAL_TIME_FIRSTRECHARGE_MONEY, data)
    //   }
    //   return {result, data}
    // },
    // async [types.GET_TOTALREAL_TIME_RIRSTRECHARGE_USER]({commit}) {
    //   const [result, data] = await realTimeTotalFirstRechargeUserApi(params);
    //   if (result) {
    //     commit(types.SET_TOTALREAL_TIME_RIRSTRECHARGE_USER, data)
    //   }
    //   return {result, data}
    // },

    async [types.GET_REAL_TIME_PROMO_USER]({commit},params) {
      const [result, data] = await realTimePromoUserApi(params);
      if (result) {
        commit(types.SET_REAL_TIME_PROMO_USER, data)
      }
      return {result, data}
    },
    async [types.GET_REAL_TIME_PROMO_AMOUNT]({commit},params) {
      const [result, data] = await realTimePromoAmountApi(params);
      if (result) {
        commit(types.SET_REAL_TIME_PROMO_AMOUNT, data)
      }
      return {result, data}
    },
    async [types.GET_REAL_TIME_ONLINE]({commit},params) {
      const [result, data] = await realTimeOnlineApi(params);
      if (result) {
        commit(types.SET_REAL_TIME_ONLINE, data)
      }
      return {result, data}
    },
    async [types.GET_REAL_TIME_GAME_PROFIT_BASIC]({commit}, params) {
      const [result, data] = await realTimeGameProfitBasicApi(params);
      if (result) {
        commit(types.SET_REAL_TIME_GAME_PROFIT_BASIC, data)
      }
      return {result, data}
    },
    async [types.GET_REAL_TIME_GAME_PROFIT]({commit},params) {
      const [result, data] = await realTimeGameProfitApi(params);
      if (result) {
        commit(types.SET_REAL_TIME_GAME_PROFIT, data)
      }
      return {result, data}
    },

  }
}

export default report
